home *** CD-ROM | disk | FTP | other *** search
Text File | 1987-05-25 | 8.1 KB | 158 lines | [TEXT/MSWD] |
-
- FEdit tricks -Tom Zusag
- ============
- Making a 405k SS disk
- ---------------------
- You can make a single-sided disk which will hold 405k of storage, but you
- give up 5k of directory blocks to do it. This leaves only room for about
- 16 file entries (more if your file names are short) in the directory.
- It might be useful on occasion, so here's how to do it. All you need is
- FEdit or some other disk block editor and a new, freshly initialized disk
- (let it keep the name "untitled.") Run FEdit, then open the volume
- "untitled." Select "Hex display", and scroll to sector 2. This is the
- start of the volume information table for the disk. The bytes you are
- interested in start at location 0010 (outlined by braces"{}" below:)
-
- Sect: 0002
- Tags: 0000 0000 0000 0000 9C1B 65F4
- 0000: D2D7 9C1B 65F4 9C1B 65F4 0000 0000 0004 ....e...e.......
- 0010:{000C 0187}0000 0400 0000 2000{0010}0000 .......... .....
- 0020:{0002 0186}0855 6E74 6974 6C65 6400 0000 .....Untitled...
-
- The meaning of this information is as follows (thanks to John Mitchell):
-
- Starting Data
- Location Explanation
- 0000 $D2D7 "RW" with the high bit set (Randy Wiggington,
- the architect of the Mac disk format)
- 0002 Date and time of initialization in seconds after 1/1/1904
- 0006 Date and time of last disk write (updated automatically)
- 000A Volume attributes
- 000C Number of file entries in directory (Gotta change this)
- 000E Starting sector for directory
- 0010 Number of sectors the directory occupies (Change this also)
- 0012 Total number of allocation blocks in volume (Ditto)
- 0014 Size of each allocation block in bytes (eg, 1024 = $0400)
- 0018 Minimum initial file allocation "Clip" size, 8096 bytes
- 001C Number of first sector for files (Another change)
- 001E The next file number to use (increments on each disk write?)
- 0022 Number of unused allocation blocks (Change this too)
- 0024 Length of the volume name
- 0025 Volume name in Ascii
-
- Now enable "Hex Modify", and make the following changes starting at these locations:
-
- Location 0010: 000C to 0002 (Change the number of directory sectors)
- Location 0012: 0187 to 018C (and the number of data blocks)
- Location 001C: 0010 to 0006 (New start of data sectors)
- Location 0020: 0002 to 0003 (Gotta do this to make it work)
- Location 0022: 0186 to 018B (New number of unused blocks)
-
- Here's what you want before you write the sector to disk:
-
- Sect: 0002
- Tags: 0000 0000 0000 0000 9C1B 65F4
- 0000: D2D7 9C1B 65F4 9C1B 65F4 0000 0000 0004 ....e...e.......
- 0010:{0002 018C}0000 0400 0000 2000{0006}0000 .......... .....
- 0020:{0003 018B}0855 6E74 6974 6C65 6400 0000 .....Untitled...
-
- Now write the sector to disk, and then FEdit will tell you that you have changed the Volume table, and it will eject the disk to prevent problems.
- Now quit FEdit. Back in the Finder, insert the disk. A box comes up
- telling you the disk needs "minor repairs." Make them. When it is
- finished, you have a disk with 405k of storage. If you look at the disk
- again with FEdit you will find that it has made changes something like that
- shown below:
-
- Sect: 0002
- Tags: 0000 0000 0000 0000 9C1B 668D
- 0000: D2D7 9C1B 668D 9C1B 668D 0040 0001 0004 ....e...f..@....
- 0010:{0002 018C}0000 0400 0000 2000{0006}0000 .......... .....
- 0020:{0004 018B}0855 6E74 6974 6C65 6400 0000 .....Untitled...
-
-
- A word on file names
- Now remember that you have just decreased the number of directory sectors
- available from $C (12 decimal) to 2. Each directory entry consists of a 50
- byte header and a variable length name. Entries may not cross sector
- boundaries. Keep your file names short! If each file name were only 1
- character, 10 entries would just fit in each 512 byte sector. If you are
- satisfied with 9 entries per sector, you file names must average only 6.8
- characters each. And so on. You can see if you are a verbose person, and
- use 36 to 52 characters for each filename, you only get 5 entries per
- sector. That's only 60 files on a normal disk, and only 10 files on a 405k
- disk.
-
-
- Locking in the Finder
- =====================
- You can modify Finder 4.1 to "lock in" the System and Finder on a disk, even
- if an application is run from another system-containing disk. As you are
- aware, the system file generally contains the fonts, desk accessories, and
- special features available at any given time. When you run an application
- which is on another disk, which has its own copy of the System and Finder,
- that system becomes the system in control of the Mac, and its desk
- accessories, fonts, etc., now supercede those available previously. This
- feature has its advantages and disadvantages, depending upon which set of
- DA's, fonts, and system files you want active. Previously, to prevent this
- kind of sleight-of-hand switching of systems, it was necessary to remove the
- system or Finder from the other application's disk. NO LONGER! By making a
- small patch to the Finder with FEdit, the Finder can be locked in place.
- Here's how. With FEdit, do a HEX Search for the string "6726554F4878" It
- should be somewhere around block 24 of the file. Change the first 7 to 0
- (zero) so that this string becomes "6026554F4878". Then write the change to
- disk. Even though the change is confined to one character, search for the
- whole string to be sure you get the correct location for the patch.
- NOTE: This Finder is so tenacious in its grasp, that it will not relinquish
- control even if you /Option/doubleclick a Finder on another disk.
-
-
- Adding Command keys to application menus
- ========================================
- You can use Fedit add or change the command key equivalents for menu items
- in any application. Here's an example using MacWrite 2.2:
-
- Run FEdit, and OPEN FILE the application to edit. Do an ASCII search for
- the first menu item you remember. For me, that was "About MacWrite." If
- you're not sure about the capitalization, check the IGNORE CASE box. After
- a nanosecond or two, you'll see a screen that shows the start of all of the
- menu items for MacWrite. Each menu item has the format: "ITEM", zero,
- command key, 3 trailing bytes. For our purposes, each item in a given menu
- can be thought of as having one of two forms when viewed by FEdit's ASCII
- display option (Command keys are already added to the two examples below
- for clarity:)
-
- Open....O... or Close.K...
-
- The dots in the above items may or may not represent actual periods or
- unprintable characters. You can find out by clicking on the dot and looking
- in the lower left of the screen to see its Hex equivalent. A real period is
- Hex 2E. You'll recall that the open menu item in MacWrite is really
- "Open...". It's actually not important, because after each menu item are
- five trailing bytes with which we are concerned. The first byte is 00. The
- second is where the command key equivalent goes. The next two are both 00,
- and the last is some kind of trailing data byte. The items for the Edit
- menu would appear thusly:
-
- Edit.Undo.Z...-.....Cut.X...Copy.C...Paste.V...-.....Show Clipboard.....
-
- It's not too hard to figure out what you have to do to change these. If you
- wanted "P" for Paste and "V" for View Clipboard, all you have to do is get
- the line to read:
-
- Edit.Undo.Z...-.....Cut.X...Copy.C...Paste.P...-.....View Clipboard.V...
-
- Remember that it's not smart to use characters which are used by other menu
- items. It doesn't really hurt anything. But the menu item farthest to the
- right/bottom is the one that will recognize the duplicate key equivalent
- first. Of course, if that one is dimmed for some reason, then the next one
- down the line gets to work. Hmmmm..... interesting.
-
- A further note. The key equivalents are limited to the character set you
- would get when using the Caps lock key down. That is, all the alphabetic
- characters (A-Z) are capitalized, and all the others are unshifted.
- Therefore you can't use the "?" as a command key equivalent, but must
- instead use the "/". You can enter it into the menu but it just won't get
- recognized. This has to be so, because the Command/shift/keys are all
- special function keys used by the system.
-
-